<?php
namespace Admin\Controller;
use Think\Model;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of SpOveralldaliyController
 *
 * @author Myron
 */
class SpOveralldaliyController extends AdminController {
     /*
      * 日结报表
      */
    public function index($b_date='',$e_date=''){ 
        $shopId=I('shopId');
        if($shopId>-1){
            $map['shopId'] =$shopId;
            $this->assign('shopId', $shopId);
        };
        if($b_date && $e_date){
            $b=strtotime($b_date);
            $e=strtotime($e_date);           
            $map['createat']=array('between',$b.','.$e);
        }
        $name = I('name');
        $map['name'] = array('like', '%' . (string) $name . '%');
        $shoplist = M('sp_shops')->where(array('status' => 1))->select();
        $this->assign('shoplist', $shoplist);
        $list = $this->lists('sp_overalldaliy', $map);
        for($i=0;$i<count($list);$i++){ 
            $list[$i]['detail']=M('sp_overalldaliydetail')->where(array('overallDaliyNum'=>$list[$i]['overallNum']))->select(); 
        }; 
        int_to_string($list);
        $this->assign('_list', $list);
        $this->meta_title = '标题';
        $this->display();
     }
}
